//
//  ChangePendingOrderView.m
//  DaiShengInvest
//
//  Created by 张睿 on 2017/7/6.
//  Copyright © 2017年 davinci. All rights reserved.
//

#import "ChangePendingOrderView.h"


@interface ChangePendingOrderView ()

@property (nonatomic, weak)UILabel * stateLabel;

@property (nonatomic, weak)UILabel * nowMoneyLabel;

@property (nonatomic, weak)UILabel * explationLabel;

@property (nonatomic, weak)UIView * lineView;

@property (nonatomic, weak)UILabel * orderInformationLabel;

@property (nonatomic, weak)UILabel * tradeKindLabel;

@property (nonatomic, weak)UILabel * tradeCountLabel;

@property (nonatomic, weak)UILabel * buyKindLabel;

@property (nonatomic, weak)UILabel * dealTimeLabel;

@property (nonatomic, weak)UIView * buttomLineView;




@end

@implementation ChangePendingOrderView


- (instancetype)initWithFrame:(CGRect)frame{
    
    if ([super initWithFrame:frame]) {
        
        [self setupUI];
    }
    
    return self;
}



- (void)setupUI{
    
    self.backgroundColor = [UIColor clearColor];
    
    UILabel * stateLabel = [UILabel new];
    
    stateLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:13 * SCREENH6];
    stateLabel.textColor = ColorWithRGB(0xffffff);
    stateLabel.textAlignment = NSTextAlignmentCenter;
    stateLabel.text = @"挂单中";
    
    self.stateLabel = stateLabel;
    
    [self addSubview:self.stateLabel];
    
    [self.stateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.top.mas_equalTo(self).offset(11 * SCREENH6);
    }];
    
    UILabel * nowMoneyLabel = [UILabel new];
    
    nowMoneyLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:23 * SCREENH6];
    nowMoneyLabel.textColor = ColorWithRGB(0xf4415f);
    nowMoneyLabel.textAlignment = NSTextAlignmentCenter;
    nowMoneyLabel.text = @"6.77666";
    
    self.nowMoneyLabel = nowMoneyLabel;
    
    [self addSubview:self.nowMoneyLabel];
    
    [self.nowMoneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.top.mas_equalTo(self.stateLabel.mas_bottom);
    }];
    
    UILabel * explationLabel = [UILabel new];
    
    explationLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:12 * SCREENH6];
    explationLabel.textColor = ColorWithRGB(0xd5d5d5);
    explationLabel.textAlignment = NSTextAlignmentCenter;
    explationLabel.text = @"(当前价)";
    
    self.explationLabel = explationLabel;
    
    [self addSubview:self.explationLabel];
    
    [self.explationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.top.mas_equalTo(self.nowMoneyLabel.mas_bottom);
    }];
    
    UIView * lineView = [UIView new];
    
    lineView.backgroundColor = [UIColor whiteColor];
    lineView.alpha = 0.05;
    
    self.lineView = lineView;
    
    [self addSubview:self.lineView];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.mas_equalTo(self);
        make.height.mas_equalTo(1 * SCREENH6);
        make.top.mas_equalTo(self.explationLabel.mas_bottom).offset(10 * SCREENH6);
    }];
    
    UILabel * orderInformationLabel = [UILabel new];
    
    orderInformationLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:14 * SCREENH6];
    orderInformationLabel.textColor = ColorWithRGB(0xa2a2a2);
    orderInformationLabel.textAlignment = NSTextAlignmentLeft;
    orderInformationLabel.text = @"订单信息";
    
    self.orderInformationLabel = orderInformationLabel;
    
    [self addSubview:self.orderInformationLabel];
    
    [self.orderInformationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self).offset(20 * SCREENH6);
        make.top.mas_equalTo(self.lineView.mas_bottom).offset(15 * SCREENH6);
    }];
    
    
    UILabel * tradeKindLabel = [UILabel new];
    
    tradeKindLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:14 * SCREENH6];
    tradeKindLabel.textColor = ColorWithRGB(0xa2a2a2);
    tradeKindLabel.textAlignment = NSTextAlignmentLeft;
    tradeKindLabel.text = @"交易品种";
    
    self.tradeKindLabel = tradeKindLabel;
    
    [self addSubview:self.tradeKindLabel];
    
    [self.tradeKindLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.orderInformationLabel);
        make.top.mas_equalTo(self.orderInformationLabel.mas_bottom).offset(10 * SCREENH6);
    }];
    
    UILabel * tradeCountLabel = [UILabel new];
    
    tradeCountLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:14 * SCREENH6];
    tradeCountLabel.textColor = ColorWithRGB(0xa2a2a2);
    tradeCountLabel.textAlignment = NSTextAlignmentLeft;
    tradeCountLabel.text = @"交易数量";
    
    self.tradeCountLabel = tradeCountLabel;
    
    [self addSubview:self.tradeCountLabel];
    
    [self.tradeCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self).offset(244 * SCREENH6);
        make.top.mas_equalTo(self.tradeKindLabel);
    }];
    
    
    UILabel * buyKindLabel = [UILabel new];
    
    buyKindLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:14 * SCREENH6];
    buyKindLabel.textColor = ColorWithRGB(0xa2a2a2);
    buyKindLabel.textAlignment = NSTextAlignmentLeft;
    buyKindLabel.text = @"买入类型";
    
    self.buyKindLabel = buyKindLabel;
    
    [self addSubview:self.buyKindLabel];
    
    [self.buyKindLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.tradeKindLabel);
        make.top.mas_equalTo(self.tradeKindLabel.mas_bottom).offset(10 * SCREENH6);
    }];
    
    
    UILabel * dealTimeLabel = [UILabel new];
    
    dealTimeLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:14 * SCREENH6];
    dealTimeLabel.textColor = ColorWithRGB(0xa2a2a2);
    dealTimeLabel.textAlignment = NSTextAlignmentLeft;
    dealTimeLabel.text = @"成交时间";
    
    self.dealTimeLabel = dealTimeLabel;
    
    [self addSubview:self.dealTimeLabel];
    
    [self.dealTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.tradeCountLabel);
        make.top.mas_equalTo(self.buyKindLabel);
    }];
    
    
    UIView * buttomLineView = [UIView new];
    
    buttomLineView.backgroundColor = [UIColor whiteColor];
    buttomLineView.alpha = 0.05;
    
    self.buttomLineView = buttomLineView;
    
    [self addSubview:self.buttomLineView];
    
    [self.buttomLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.mas_equalTo(self);
        make.height.mas_equalTo(1 * SCREENH6);
        make.top.mas_equalTo(self.dealTimeLabel.mas_bottom).offset(20 * SCREENH6);
    }];

}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
